package me.pra.melo.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

public class Main {
    public static void main(String[] args) throws ClassNotFoundException {
        parseAnnotation();
    }

    public static void parseAnnotation() throws ClassNotFoundException {
        for (Method method: Main.class.getClassLoader().loadClass("me.pra.melo.annotation.AnnotationExample").getMethods()){
            if(method.isAnnotationPresent(MethodInfo.class)){
                for (Annotation annotation: method.getDeclaredAnnotations()){
                    System.out.println("method is:"+method +"|"+"anno:"+annotation);
                }
                MethodInfo methodInfo = method.getAnnotation(MethodInfo.class);
                System.out.println(methodInfo.date());
            }

        }
    }
}
